// index.js
// 获取应用实例
const app = getApp()
const mini = wx.getAccountInfoSync()
const version = mini.miniProgram.version || mini.miniProgram.envVersion
import Queue from '../../utils/Queue'
import dayjs from 'dayjs'
import {
    getUserInfoByUserId,
    getProject,
    placeFile,
    setProjectName,
    getProjectList,
    alterPayProjectList,
    joinProject,
    workInvitationLeader,
    switchUserCompany,
    getAccountExpireNotify,
    getAccountProductInfoSimplify,
    dybbAd
} from '../../api/app.js'
import user from '../../utils/user.js'
import {
    shake
} from '../../utils/util'
import global from '../../utils/global'

Page({
    data: {
        static: {
            payAllList: [],
            payAllListNum: 0,
            payDayList: [],
            payDayListNum: 0,
            payMonthList: [],
            payMonthListNum: 0
        },
        shownewyeartc: false,
        seattcflag: false,
        isopenpay: true,
        isPopupPay: false,
        tabs: [
            '全部',
            '无打卡',
            '需打卡'
        ],
        inviteRegisterStatus: false,
        invite: '',
        top: app.globalData.menuTop,
        showMoreStatus: false,
        morePosition: 0,
        current: 0,
        addProjectStatus: false,
        projectList: [],
        videoStatus: false,
        isAdmin: false,
        hasNext: true,
        pageNum: 1,
        noBuyUser: false,
        setProjectNameId: false,
        setProjectNameIndex: false,
        searchText: '',
        expirationTime: {},
        isPayActivity: true,
        popupQueue: '',
        isLogon: true,
        isFatherLogon: false,
        cancel: true,
        showDialog: false,
        showdybbad: false,
        showndzd2023: false,
        showndzd2023c: false,
        showdybbadc: false,
        srcolling: false,
        timer: null,
        showStudy: !wx.getStorageSync('closeStudyJapan'),
        showFilter: false, // 是否显示筛选
        filterName: '近7天',
        tempFilterName: '近7天',
        periodValue: 0,
        tempPeriodValue: 0,
        periodOption: [{
            label: '全部',
            value: ''
        },
        {
            label: '近7天',
            value: 0
        },
        {
            label: '近30天',
            value: 1
        },
        {
            label: '近1年',
            value: 2
        },
        ],
        queryStartTime: dayjs().subtract(7, 'day').format('YYYY/MM/DD'),
        queryEndTime: dayjs().format('YYYY/MM/DD')
    },

    dateChange(time) {
        time = time.detail
        this.setData({
            day: time
        })
    },
    todybbdetail() {
        this.dybbAdfn(1, 0, 0)
        wx.navigateTo({
            url: '/packageAd/pages/dybb/dybb',
        })
        this.setData({
            showdybbad: false,
            showdybbadc: false
        })
        wx.setStorageSync('hascolsedybbflag', true)
    },
    tondzd() {
        console.log('去年度账单页面内')
        this.setData({
            showndzd2023c: true,
            showndzd2023: false,
        })
        wx.setStorageSync('showndzd2023', true)
        if (wx.getStorageSync('hasRead2023ndzd')) {
            wx.navigateTo({
                url: '/packageActivitys/inviteFriends/inviteFriends',
            })
        } else {
            wx.navigateTo({
                url: '/packageActivitys/annualSpendingReport/annualSpendingReport',
            })
        }
    },
    closeStudy() {
        wx.setStorageSync('closeStudyJapan', true)
        this.setData({
            showStudy: false
        })
        console.log(123)
    },
    toStudy() {
        dybbAd({
            isClick: 1,
            type: 2,
        }).then(() => {
            wx.navigateTo({
                url: '/packageAd/pages/studyJapan/studyJapan'
            })
        })
    },
    closendzdc() {
        this.setData({
            showndzd2023c: false,
            showndzd2023: false,
        })
        wx.setStorageSync('showndzd2023c', true)
    },
    colorndzd() {
        this.setData({
            showndzd2023: false
        })
        wx.setStorageSync('showndzd2023', true)
        if (!wx.getStorageSync('showndzd2023c')) {
            this.setData({
                showndzd2023c: true
            })
        } else {
            this.setData({
                showndzd2023c: false
            })
        }
    },
    ndzdbg() {
        dybbAd({
            isShare: 0,
            isExposure: 1,
            type: 1,
        }).then((res) => {
            console.log(res, 'fgasgyfjiusagygyasu')
        })
    },
    dybbAdfn(isClick, isExposure, isPhone) {
        dybbAd({
            isClick: isClick,
            isExposure: isExposure,
            isPhone: isPhone,
            companyName: user.companyName,
            phone: user.phoneNum,
            type: 0,
        }).then((res) => {
            console.log(res, 'fgasgyfjiusagygyasu')
        })
    },
    closenewyeartc() {
        console.log(111)
        wx.setStorageSync('2025newyearPop', 'true')
        this.setData({
            shownewyeartc: false
        })
    },
    toMidAutumnFestival() {
        wx.navigateTo({
            url: '/pages/mid-autumn-festival/mid-autumn-festival',
        })
    },
    onShow() {
        this.getTabBar().setData({
            selected: 0
        })
        let newyearenddate = new Date('2025/02/05 00:00:00').getTime()
        let startnewyearenddate = new Date('2025/01/20 00:00:00').getTime()
        let nowdate = new Date().getTime()
        console.log(nowdate < newyearenddate)
        if (nowdate < newyearenddate && nowdate > startnewyearenddate) {
            if (wx.getStorageSync('2025newyearPop')) {
                this.setData({
                    shownewyeartc: false
                })
            } else {
                this.setData({
                    shownewyeartc: true
                })
            }
        } else {
            this.setData({
                shownewyeartc: false
            })
        }
        const hasshow = wx.getStorageSync('hasshow')
        user.waitLogin().then(async () => {
            this.setData({
                isAdmin: user.isAdmin,
                'companyName': user.companyName,
                noBuyUser: !user.auditStatus,
                isPayActivity: user.isPayActivity,
                popupQueue: new Queue(this),
                isFatherLogon: global.token ? true : false
            })
            if (!wx.getStorageSync('showndzd2023')) {
                this.setData({
                    showndzd2023: true,
                    showndzd2023c: false
                })
            } else {
                if (!wx.getStorageSync('showndzd2023c')) {
                    this.setData({
                        showndzd2023: false,
                        showndzd2023c: true
                    })
                } else {
                    this.setData({
                        showndzd2023: false,
                        showndzd2023c: false
                    })
                }
            }
            this.getProjectList(true)
            getAccountProductInfoSimplify().then(res => {
                this.setData({
                    isopenpay: res.pay.isOpen,
                    seattcflag: !hasshow
                })
            })
            if (user.isOpenPaySalary) {
                if (!user.expireStatus) {
                    const result = await getAccountExpireNotify()
                    this.setData({
                        expirationTime: result
                    })
                    if (result.status === 2 || result.status === 3) {
                        this.data.popupQueue.register('popupRemind')
                    }
                }
            }
            if (version !== wx.getStorageSync('version')) {
                this.data.popupQueue.register('versionTip')
            }
            this.setData({
                ['popupQueue.queue']: this.data.popupQueue.queue
            })
        }).catch(() => {
            this.setData({
                isFatherLogon: global.token ? true : false
            })
        })
    },
    bindscrollfn() {
        this.setData({
            srcolling: true
        })
        if (this.data.timer) clearTimeout(this.data.timer)
        this.data.timer = setTimeout(() => {
            this.setData({
                srcolling: false
            })
        }, 1000)
    },
    onLoad(option) {
        const homeFilterData = wx.getStorageSync('homeFilterData')
        if (homeFilterData) {
            this.setData({
                filterName: homeFilterData.filterName,
                tempFilterName: homeFilterData.filterName,
                periodValue: homeFilterData.periodValue,
                tempPeriodValue: homeFilterData.periodValue,
                // queryStartTime: homeFilterData.queryStartTime,
                // queryEndTime: homeFilterData.queryEndTime
            })
        }

        if (option.scene) {
            let scene = decodeURIComponent(option.scene)
            scene = scene.split('&')
            for (const i in scene) {
                const query = scene[i].split('=')
                option[query[0]] = query[1]
            }
            option.userId = option.uId
            option.companyId = option.cId
            option.projectId = option.pId
            option.createUserId = option.cUId
            option.jobId = option.jId
            console.log(option, 'option')
        }
        // 招聘岗位邀请
        if ((option.createUserId && option.jobId) || (option.userId && option.companyId)) {
            console.log('进入啦')
            user.waitLogin().then(() => {
                console.log()
                getUserInfoByUserId({
                    userId: option.userId || option.createUserId,
                    companyId: option.companyId
                }).then(res => {
                    console.log(res, 'resres')
                    if (!res[0]) {
                        app.toast('未找到该用户')
                        return 0
                    }
                    option.userName = res[0].userName
                    option.companyName = res[0].companyName
                    const isCompany = (user.companyIdList.length > 0 && user.companyIdList.indexOf(Number(option.companyId)) !== -1)
                    console.log(isCompany, '123')
                    // 加入公司
                    if (!isCompany) {
                        this.setData({
                            inviteRegisterStatus: true,
                            invite: option
                        })
                        return
                    }

                    // 招聘驻场邀请
                    if (option.createUserId && option.jobId) {
                        if (option.companyId && option.companyId !== user.companyId) {
                            // 不在当前公司 切换公司
                            switchUserCompany({
                                companyId: option.companyId,
                                userId: user.userId
                            }).then(() => {
                                // 切换公司后加入项目
                                user.reLogin().then(() => {
                                    this.joinWork(option)
                                })
                            })
                        } else {
                            // 已在当前公司 直接进入
                            // 在公司加入该岗位 管理列表
                            this.joinWork(option)
                        }
                    }
                    // 发薪驻场邀请
                    else if (option.userId && option.companyId) {
                        if (!option.projectId && isCompany) {
                            app.alert('您已加入该公司，请不要重复加入')
                            return
                        } else {
                            this.setData({
                                invite: option
                            })
                            this.registerComplete()
                        }
                    }
                })
            }, () => {
                // 从未注册过的人 先被邀请进入公司 在进入驻厂
                console.log('你没有注册')
                this.setData({
                    inviteRegisterStatus: true,
                    invite: option
                })
            })
        } else {
            user.waitLogin().then(() => {
                if (!user.hasPassword) {
                    app.confirm('您还没有为该公司设置验证密码，是否立即前往？').then(() => {
                        wx.navigateTo({
                            url: '/pages/password/password?type=set&oldPass='
                        })
                    })
                }
            })
        }
    },
    switchtab(event) {
        if (!user.userId) {
            app.confirm('您还未登录，是否立即登录？').then(() => {
                user.goRegister()
            })
            return
        }
        this.setData({
            current: event.currentTarget.dataset.index,
            pageNum: 1,
            // hasNext: true
        })
        this.alterPayProjectList()
    },
    seattcclose() {
        wx.setStorageSync('hasshow', true)
        this.setData({
            seattcflag: false
        })
    },
    topayseatrecharge() {
        this.seattcclose()
        wx.navigateTo({
            url: '/packageInsurance/pages/insurance-recharge-bullet/insurance-recharge-bullet?type=payRenew'
        })
    },
    // 加入 管理招聘企业
    joinWork(option) {
        console.log(option, 'option')
        workInvitationLeader({
            jobId: option.jobId,
            createUserId: option.createUserId
        }).then(() => {
            app.toast('您已成功加入该招聘岗位')
        })
    },
    /**
     * 检测列表是否发生改变
     */
    alterPayProjectList() {
        alterPayProjectList({
            type: (this.data.current ? (this.data.current - 1) : ''),
            searchName: this.data.searchText
        }).then(res => {
            console.log(res, '检测')
            console.log(this.data.current, 'current')
            switch (this.data.current) {
                case 0:
                    if (this.data.static.payAllListNum == res) {
                        this.setData({
                            projectList: this.data.static.payAllList
                        })
                    } else {
                        this.getProjectList(true, this.data.current ? (this.data.current - 1) : null)
                    }
                    break
                case 1:
                    if (this.data.static.payDayListNum == res) {
                        this.setData({
                            projectList: this.data.static.payDayList
                        })
                    } else {
                        this.getProjectList(true, this.data.current ? (this.data.current - 1) : null)
                    }
                    break
                case 2:
                    if (this.data.static.payMonthListNum == res) {
                        this.setData({
                            projectList: this.data.static.payMonthList
                        })
                    } else {
                        this.getProjectList(true, this.data.current ? (this.data.current - 1) : null)
                    }
                    break
            }
        })
    },
    // 显示更多
    showMore(event) {
        const list = [{
            text: '电话',
            key: event.currentTarget.dataset.phone,
            icon: '',
            bind: 'call'
        },
        {
            text: '标记大神',
            key: event.currentTarget.dataset.index,
            icon: '',
            bind: 'mark'
        }
        ]
        // 如果是老项目，不允许删除员工
        if (!this.data.isOld) {
            list.push({
                text: '删除',
                key: event.currentTarget.dataset.index,
                icon: '',
                bind: 'delete'
            })
        }
        this.setData({
            'moreList': list
        })
        this.setData({
            morePosition: event.touches[0].clientY + 6,
            showMoreStatus: true
        })
    },
    // 跳转到登录
    login() {
        user.goRegister()
    },
    hideMore() {
        this.setData({
            showMoreStatus: false
        })
    },
    // 被邀请加入团队
    inviteProject(option) {
        // option.projectId && option.userId
        getUserInfoByUserId({
            userId: option.userId
        }).then(res => {
            if (!res[0]) {
                app.alert('未找到该用户')
                return 0
            }
            const userName = res[0].userName
            const companyId = res[0].companyId
            if (companyId !== user.companyId) {
                app.alert('该用户与您不在同一公司，无法加入该项目！')
                return 0
            }

            getProject({
                id: option.projectId
            }).then(res => {
                app.confirm(userName + '邀请您加入' + res.supplierName + '是否立即加入？')
                    .then(() => {
                        this.joinProject(option)
                    })
            })

        })

    },

    onPcPay() {
        wx.navigateTo({
            url: '/packagePay/pages/pc-pay/pc-pay'
        })
    },
    onPayRecord() {
        wx.navigateTo({
            url: '/packagePay/pages/billOfPay/billOfPay'
        })
    },
    onFastPay() {
        if (user.quickProject) {
            wx.navigateTo({
                url: '/packagePay/pages/fast-pay/fast-pay'
            })
        } else {
            wx.navigateTo({
                url: '/packagePay/pages/fast-pay-guide/fast-pay-guide'
            })
        }

    },
    // 加入团队
    joinProject(option) {
        user.reLogin().then(() => {
            joinProject({
                userId: user.userId,
                projectId: option.projectId,
                createUserId: option.userId
            }).then(() => {
                app.toast('加入项目成功！', 'success')
                setTimeout(() => {
                    this.getProjectList()
                    if (!user.hasPassword) {
                        app.confirm('您还没有为该公司设置验证密码，是否立即前往？').then(() => {
                            wx.navigateTo({
                                url: '/pages/password/password?type=set&oldPass='
                            })
                        })
                    }
                }, 1500)
            })
        })

    },
    setProjectName(event) {
        this.setData({
            setProjectNameId: event.detail,
            setProjectNameIndex: event.currentTarget.dataset.index
        })
    },
    onCancelProjectName() {
        this.setData({
            setProjectNameId: false,
            setProjectNameIndex: false
        })
    },
    onSetProjectName(event) {
        if (!event.detail.name) {
            app.toast('请输入项目名称')
            return
        }
        setProjectName({
            id: this.data.setProjectNameId,
            projectName: event.detail.name
        }).then(() => {
            app.toast('修改成功', 'success')
            this.setData({
                setProjectNameId: false,
                ['projectList[' + this.data.setProjectNameIndex + '].projectName']: event.detail.name
            })
        })
    },

    // 注册
    inviteRegister(option) {
        getUserInfoByUserId({
            userId: option.userId
        }).then(res => {
            if (!res[0]) {
                app.toast('未找到该用户')
                return 0
            }
            option.userName = res[0].userName
            option.companyName = res[0].params.companyName
            option.companyId = res[0].companyId
            this.setData({
                inviteRegisterStatus: true,
                invite: option
            })
        })
    },
    // 注册成功
    registerComplete() {
        this.setData({
            companyName: user.companyName,
            inviteRegisterStatus: false
        })
        user.login().then(user => {
            this.setData({
                'companyName': user.companyName
            })
            if (this.data.invite.projectId) {
                this.joinProject(this.data.invite)
            } else {
                user.reLogin().then(() => {
                    wx.reLaunch({
                        url: '/pages/index/index',
                    })
                })
            }
        })
    },
    // 获取当前用户日程
    getProjectList(first, tabsIndex = null) {
        if (first) {
            this.data.pageNum = 1
            this.data.hasNext = true
        }
        getProjectList({
            companyId: user.companyId,
            type: this.data.current ? (this.data.current - 1) : null,
            params: {
                userId: user.userId
            },
            pageNum: this.data.pageNum,
            pageSize: 50,
            searchName: this.data.searchText,
            queryType: this.data.periodValue
            // queryStartTime: this.data.queryStartTime.replace(/\//g, '-'),
            // queryEndTime: this.data.queryEndTime.replace(/\//g, '-')
        }).then((res) => {
            console.log(res, 'this.data.')
            if (!res.hasNextPage) {
                this.setData({
                    hasNext: false
                })
            } else {
                this.data.hasNext = true
            }
            if (first) {
                this.data.projectList = []
            }
            const projectList = this.data.projectList
            projectList.push(...res.list)
            console.log(tabsIndex, 'tabsIndex')
            if (tabsIndex === 0) {
                this.data.static.payDayList = projectList
                this.data.static.payDayListNum = res.totalCount
            } else if (tabsIndex === 1) {
                this.data.static.payMonthList = projectList
                this.data.static.payMonthListNum = res.totalCount
            } else {
                this.data.static.payAllList = projectList
                this.data.static.payAllListNum = res.totalCount
            }
            console.log(this.data.static.payAllList, 111)
            this.setData({
                projectList: tabsIndex == null ? this.data.static.payAllList : tabsIndex == 0 ? this.data.static.payDayList : this.data.static.payMonthList
            })
        })
    },
    onScroll() {
        console.log(this.data.hasNext, 'hasNext')
        if (!this.data.hasNext) {
            return
        }
        this.setData({
            pageNum: this.data.pageNum + 1
        })
        this.getProjectList()
    },
    // 创建项目成功
    appProjectComplete(event) {
        this.hideAddProject()
        app.toast('创建项目成功，正在为您跳转')
        setTimeout(() => {
            this.getProjectList()
            wx.navigateTo({
                url: '/packagePay/pages/resident/resident?id=' + event.detail
            })
        }, 2000)
    },

    // 归档项目
    onPlaceFile(event) {
        wx.showModal({
            title: '项目归档',
            content: '项目归档后不会影响其他项目成员查看项目，如需查看可至“工作台-归档项目”中查看',
            confirmColor: '#00D679',
            confirmText: '确定归档',
            success: (res) => {
                if (res.confirm) {
                    placeFile({
                        id: event.detail,
                        isArchived: 1
                    }).then(() => {
                        app.toast('项目归档成功', 'success')
                        this.data.projectList.splice(event.currentTarget.dataset.index, 1)
                        this.setData({
                            projectList: this.data.projectList
                        })


                    })
                }
            }
        })
    },

    // 前往项目详细页面
    goResident(event) {
        console.log(event)
        wx.navigateTo({
            url: '/packagePay/pages/resident/resident?id=' + event.currentTarget.dataset.id
        })
    },
    // 隐藏添加项目弹窗
    hideAddProject() {
        this.setData({
            addProjectStatus: false
        })
    },
    // 显示添加项目弹窗
    async showAddProject() {

        if (!user.userId) {
            app.confirm('您还未登录，是否立即登录？').then(() => {
                user.goRegister()
            })
            return 0
        }
        // 先判断 是否开通发薪
        // if(!user.isOpenPaySalary){
        //     this.setData({
        //         isPopupPay:true
        //     })
        //     return
        // }
        // if (!user.isSeatAdmin && !user.isSuperAdmin) {
        if (!user.isSeatAdmin) {
            wx.showToast({
                title: '权限不足，当前功能需发薪席位人员才可创建',
                icon: 'none'
            })
            return
        }
        const result = await getAccountExpireNotify()
        // 判断是否
        if (!user.expireStatus && result.status === 2) {
            this.setData({
                expirationTime: result
            })
            this.data.popupQueue.register('popupRemind')
            this.setData({
                ['popupQueue.queue']: this.data.popupQueue.queue
            })
            return
        }

        if (result.status === 3) {
            this.setData({
                expirationTime: result
            })
            this.data.popupQueue.register('popupRemind')
            this.setData({
                ['popupQueue.queue']: this.data.popupQueue.queue
            })
            if (result.status === 3) {
                return
            }
        }
        wx.navigateTo({
            url: '../../packagePay/pages/new-create-project/new-create-project',
        })

        // this.setData({
        //     addProjectStatus: true
        // })
    },
    completeSubscription() {
        this.setData({
            showSubscription: false
        })
    },
    onShareAppMessage() {
        return {
            title: user.userName + '邀请您一起使用子弹发薪|无卡发薪快一步',
            imageUrl: '/assets/img/home/share.png'
        }
    },
    onShareTimeline() {
        return {
            title: '我在使用【子弹发薪 | 无卡发薪快一步】',
            imageUrl: '/assets/img/home/share.png'
        }
    },
    showVideo() {
        this.setData({
            videoStatus: true
        })
    },
    closeVideo() {
        app.toast('感谢您的观看，现在开始体验吧！')
        this.setData({
            videoStatus: false
        })
    },
    /**
     * 根据项目名称搜索
     */
    searchWorker(event) {
        shake(() => {
            const {
                value
            } = event.detail
            console.log(value, 'value')
            this.setData({
                searchText: value,
                projectList: [],
                pageNum: 1,
                // hasNext:true
            })
            this.alterPayProjectList()
        })
    },
    // 跳转到活动界面
    onActivity() {
        wx.navigateTo({
            url: '/packageActivity/pages/activity/activity'
        })
    },
    // 关闭活动页面
    onCloseActivity() {
        console.log('点击啦')
        this.setData({
            isPayActivity: false
        })
        user.isPayActivity = false
    },
    // 关闭弹窗
    onClose() {
        this.setData({
            isPopupPay: false
        })
    },
    next() {
        this.data.popupQueue.next()
        this.setData({
            popupQueue: this.data.popupQueue
        })
    },
    onFloor() {
        console.log('回调点击出现函数')
        this.setData({
            isLogon: false
        })
    },
    cancelTwo(e) {
        console.log(e, 'e是什么')
        this.setData({
            cancel: false
        })
    },
    blankCloseTwo(e) {
        console.log(e, 'blankCloseblankClose')
        this.setData({
            cancel: false
        })
    },
    onLogonCancel() {
        console.log('点击取消的回调')
        this.setData({
            isLogon: true
        })
    },
    handleCloseDialog() {
        this.setData({
            showDialog: false
        })
    },
    toDybb() {
        this.dybbAdfn(1, 0, 0)
        wx.navigateTo({
            url: '/packageAd/pages/dybb/dybb'
        })
    },
    handleSelectPeriod(ev) {
        const dataset = ev.currentTarget.dataset
        this.data.tempFilterName = dataset.label
        this.setData({
            periodValue: dataset.value,
        })
    },
    handleShowFilter() {
        this.setData({
            showFilter: true
        })
        this.data.tempPeriodValue = this.data.periodValue
    },
    handleFilterCancel() {
        this.setData({
            periodValue: this.data.tempPeriodValue,
            showFilter: false
        })
    },
    handleFilterConfirm() {
        this.data.tempPeriodValue = this.data.periodValue
        this.setData({
            periodValue: this.data.tempPeriodValue,
            filterName: this.data.tempFilterName
        })
        switch (this.data.periodValue) {
            case '': // 全部
                this.setData({
                    queryStartTime: '',
                    queryEndTime: ''
                })
                break
            case 0: // 近七天
                this.setData({
                    queryStartTime: dayjs().subtract(7, 'day').format('YYYY/MM/DD'),
                    queryEndTime: dayjs().format('YYYY/MM/DD')
                })
                break
            case 1: // 近30天
                this.setData({
                    queryStartTime: dayjs().subtract(30, 'day').format('YYYY/MM/DD'),
                    queryEndTime: dayjs().format('YYYY/MM/DD')
                })
                break
            case 2: // 近一年
                this.setData({
                    queryStartTime: dayjs().subtract(365, 'day').format('YYYY/MM/DD'),
                    queryEndTime: dayjs().format('YYYY/MM/DD')
                })
                break
        }
        this.getProjectList(true, this.data.current ? (this.data.current - 1) : null)

        const homeFilterData = {
            periodValue: this.data.periodValue,
            filterName: this.data.tempFilterName,
            // queryStartTime: this.data.queryStartTime,
            // queryEndTime: this.data.queryEndTime
        }
        wx.setStorageSync('homeFilterData', homeFilterData)
        this.handleFilterCancel()
    },
    onPullDownRefresh() {
        this.getProjectList(true)
    }
})